package com.zxy.ziems.server.statistics.controller;

import com.zxy.btp.security.annotation.IgnoreLogin;
import com.zxy.ziems.server.collection.service.CollectionService;
import com.zxy.ziems.server.collection.task.CollectionTask;
import com.zxy.ziems.server.dto.DataQueryDto;
import com.zxy.ziems.server.statistics.service.GeneralExportService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用数据表格到导出
 */
@RestController
@RequestMapping("/api/generalExport")
public class GeneralExportController {

    @Autowired
    CollectionTask collectionTask;

    @Autowired
    private GeneralExportService generalExportService;
    
    @GetMapping("/export")
    public void export(HttpServletResponse response, DataQueryDto dataQueryDto) {
        generalExportService.export(response, dataQueryDto);
    }

    @IgnoreLogin
    @GetMapping("/synwater")
    public void synwater() {
        collectionTask.syncWaterData();
    }


}
